VERSION 5.00
Begin VB.UserControl Skin 
   BackColor       =   &H00400000&
   ClientHeight    =   7230
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   11955
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   InvisibleAtRuntime=   -1  'True
   ScaleHeight     =   482
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   797
   Begin VB.PictureBox pTrackBarVerBold 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   945
      Left            =   10575
      Picture         =   "Skin.ctx":0000
      ScaleHeight     =   63
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   15
      TabIndex        =   32
      Top             =   3060
      Visible         =   0   'False
      Width           =   225
   End
   Begin VB.PictureBox pTrackBarHorBold 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   675
      Left            =   10050
      Picture         =   "Skin.ctx":0C12
      ScaleHeight     =   45
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   21
      TabIndex        =   31
      Top             =   3090
      Visible         =   0   'False
      Width           =   315
   End
   Begin VB.PictureBox pTrackBarVerBottom 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   945
      Left            =   10560
      Picture         =   "Skin.ctx":1794
      ScaleHeight     =   63
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   11
      TabIndex        =   30
      Top             =   1680
      Visible         =   0   'False
      Width           =   165
   End
   Begin VB.PictureBox pTrackBarHorRight 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   495
      Left            =   9900
      Picture         =   "Skin.ctx":20B2
      ScaleHeight     =   33
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   21
      TabIndex        =   29
      Top             =   2340
      Visible         =   0   'False
      Width           =   315
   End
   Begin VB.PictureBox pMenuItem 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   660
      Left            =   11265
      Picture         =   "Skin.ctx":2934
      ScaleHeight     =   44
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   23
      TabIndex        =   28
      Top             =   120
      Visible         =   0   'False
      Width           =   345
   End
   Begin VB.PictureBox pSpinHor 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   2040
      Left            =   9360
      Picture         =   "Skin.ctx":35D6
      ScaleHeight     =   136
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   10
      TabIndex        =   27
      Top             =   5025
      Visible         =   0   'False
      Width           =   150
   End
   Begin VB.PictureBox pProgressHor 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1560
      Left            =   3795
      Picture         =   "Skin.ctx":4718
      ScaleHeight     =   104
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   18
      TabIndex        =   26
      Top             =   525
      Visible         =   0   'False
      Width           =   270
   End
   Begin VB.PictureBox pTrackBarHorLeft 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   495
      Left            =   9900
      Picture         =   "Skin.ctx":5E1A
      ScaleHeight     =   33
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   21
      TabIndex        =   25
      Top             =   1740
      Visible         =   0   'False
      Width           =   315
   End
   Begin VB.PictureBox pTrackBarVerTop 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   945
      Left            =   10335
      Picture         =   "Skin.ctx":669C
      ScaleHeight     =   63
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   11
      TabIndex        =   24
      Top             =   1725
      Visible         =   0   'False
      Width           =   165
   End
   Begin VB.PictureBox pMenuLeft 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   30
      Left            =   10725
      Picture         =   "Skin.ctx":6FBA
      ScaleHeight     =   2
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   28
      TabIndex        =   20
      Top             =   225
      Visible         =   0   'False
      Width           =   420
   End
   Begin VB.PictureBox pMenuCheckBorder 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   900
      Left            =   10095
      Picture         =   "Skin.ctx":70A4
      ScaleHeight     =   60
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   20
      TabIndex        =   22
      Top             =   60
      Visible         =   0   'False
      Width           =   300
   End
   Begin VB.PictureBox pMenuCheck 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   960
      Left            =   9780
      Picture         =   "Skin.ctx":7EF6
      ScaleHeight     =   64
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   16
      TabIndex        =   21
      Top             =   30
      Visible         =   0   'False
      Width           =   240
   End
   Begin VB.PictureBox pMDITabFrame 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   180
      Left            =   8940
      Picture         =   "Skin.ctx":8B38
      ScaleHeight     =   12
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   12
      TabIndex        =   19
      Top             =   4320
      Visible         =   0   'False
      Width           =   180
   End
   Begin VB.PictureBox pMDITab 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   630
      Left            =   8850
      Picture         =   "Skin.ctx":8D2A
      ScaleHeight     =   42
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   26
      TabIndex        =   18
      Top             =   3600
      Visible         =   0   'False
      Width           =   390
   End
   Begin VB.PictureBox pToolbarButton 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1650
      Left            =   3540
      Picture         =   "Skin.ctx":9A8C
      ScaleHeight     =   110
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   23
      TabIndex        =   17
      Top             =   4785
      Visible         =   0   'False
      Width           =   345
   End
   Begin VB.PictureBox pToolbarButtonDropDownRight 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1650
      Left            =   4275
      Picture         =   "Skin.ctx":B9BE
      ScaleHeight     =   110
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   11
      TabIndex        =   16
      Top             =   4770
      Visible         =   0   'False
      Width           =   165
   End
   Begin VB.PictureBox pToolbarButtonDropDown 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1650
      Left            =   3930
      Picture         =   "Skin.ctx":C978
      ScaleHeight     =   110
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   23
      TabIndex        =   15
      Top             =   4770
      Visible         =   0   'False
      Width           =   345
   End
   Begin VB.PictureBox pToolbar 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1275
      Left            =   4890
      Picture         =   "Skin.ctx":E8AA
      ScaleHeight     =   85
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   34
      TabIndex        =   14
      Top             =   1965
      Visible         =   0   'False
      Width           =   510
   End
   Begin VB.PictureBox pSpinVer 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1200
      Left            =   9675
      Picture         =   "Skin.ctx":10B74
      ScaleHeight     =   80
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   17
      TabIndex        =   13
      Top             =   5430
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.PictureBox pCombobox 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1140
      Left            =   3045
      Picture         =   "Skin.ctx":11BF6
      ScaleHeight     =   76
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   15
      TabIndex        =   12
      Top             =   4935
      Visible         =   0   'False
      Width           =   225
   End
   Begin VB.PictureBox pArrow 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   2700
      Left            =   5850
      Picture         =   "Skin.ctx":12A78
      ScaleHeight     =   180
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   9
      TabIndex        =   11
      Top             =   690
      Visible         =   0   'False
      Width           =   135
   End
   Begin VB.PictureBox pScrollThumbHor 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1020
      Left            =   7635
      Picture         =   "Skin.ctx":13E6A
      ScaleHeight     =   68
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   21
      TabIndex        =   10
      Top             =   4665
      Visible         =   0   'False
      Width           =   315
   End
   Begin VB.PictureBox pScrollThumbVer 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1320
      Left            =   7320
      Picture         =   "Skin.ctx":14FAC
      ScaleHeight     =   88
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   17
      TabIndex        =   9
      Top             =   4650
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.PictureBox pScrollButton 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   5100
      Left            =   6855
      Picture         =   "Skin.ctx":161CE
      ScaleHeight     =   340
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   17
      TabIndex        =   8
      Top             =   795
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.PictureBox pStatusBar 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1320
      Left            =   1695
      Picture         =   "Skin.ctx":1A720
      ScaleHeight     =   88
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   3
      TabIndex        =   7
      Top             =   2715
      Visible         =   0   'False
      Width           =   45
   End
   Begin VB.PictureBox pTab 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1380
      Left            =   4680
      Picture         =   "Skin.ctx":1AB82
      ScaleHeight     =   92
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   80
      TabIndex        =   6
      Top             =   3510
      Visible         =   0   'False
      Width           =   1200
   End
   Begin VB.PictureBox pTabTop 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1800
      Left            =   7350
      Picture         =   "Skin.ctx":20204
      ScaleHeight     =   120
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   57
      TabIndex        =   5
      Top             =   1515
      Visible         =   0   'False
      Width           =   855
   End
   Begin VB.PictureBox pListView 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1575
      Left            =   4305
      Picture         =   "Skin.ctx":252E6
      ScaleHeight     =   105
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   17
      TabIndex        =   4
      Top             =   2370
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.PictureBox pOption 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1560
      Left            =   3420
      Picture         =   "Skin.ctx":2687C
      ScaleHeight     =   104
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   13
      TabIndex        =   3
      Top             =   1770
      Visible         =   0   'False
      Width           =   195
   End
   Begin VB.PictureBox pCheck 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   2340
      Left            =   2565
      Picture         =   "Skin.ctx":278FE
      ScaleHeight     =   156
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   13
      TabIndex        =   2
      Top             =   1770
      Visible         =   0   'False
      Width           =   195
   End
   Begin VB.PictureBox pProgress 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   510
      Left            =   1020
      Picture         =   "Skin.ctx":291A0
      ScaleHeight     =   34
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   125
      TabIndex        =   1
      Top             =   720
      Visible         =   0   'False
      Width           =   1875
   End
   Begin VB.PictureBox pButton 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00F0F0F0&
      BorderStyle     =   0  'None
      CausesValidation=   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   4950
      Left            =   285
      Picture         =   "Skin.ctx":2C3D2
      ScaleHeight     =   330
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   43
      TabIndex        =   0
      Top             =   735
      Visible         =   0   'False
      Width           =   645
   End
   Begin VB.Label Label1 
      BackColor       =   &H00F0F0F0&
      Caption         =   "Skinner"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   360
      Left            =   105
      TabIndex        =   23
      Top             =   60
      Width           =   1065
   End
End
Attribute VB_Name = "Skin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private Declare Function SetRectEmpty Lib "user32" (lpRect As RECT) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long

Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long

Private Type POINTAPI
        X As Long
        Y As Long
End Type

Private Declare Function TransparentBlt Lib "Msimg32.dll" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal crTransparent As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Declare Function SetStretchBltMode Lib "gdi32.dll" (ByVal hdc As Long, ByVal nStretchMode As Long) As Long
'Dim RC.Left As Long, RC.Top As Long, RC.Right As Long, RC.Bottom As Long
Dim m As New GraphicsTools

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Public Sub ThemeCommandBarMenu(ByVal hwnd As Long, ByVal lhDC As Long, ByVal plDraw As Integer, ByVal State As Integer, ByVal mnLeft As Long, ByVal mnTop As Long, ByVal mnRight As Long, ByVal mnBottom As Variant, Optional lReturn As Variant)
    Dim mRECT As RECT
    On Error Resume Next
    Dim RC As RECT

    With RC
        .Left = 3
        .Top = 3
        .Right = 3
        .Bottom = 3
    End With
    
    With mRECT
        .Left = mnLeft
        .Top = mnTop
        .Right = mnRight
        .Bottom = mnBottom
    End With
    
    Select Case plDraw
        Case 0 'Draw MenuCustom
            If State = 0 Then 'Draw Custom [Bar]
                m.DrawFill lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, &HDEC1AB
            ElseIf State = 1 Then 'Draw Custom Cell Selected
                'M.DrawFill lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, M.TranslateColors(&HEDD0BF)
                'M.DrawFrame lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, M.TranslateColors(&HC56A31)
                DrawDC lhDC, pMenuCheckBorder.hdc, RC, mRECT, pMenuCheckBorder.Width, pMenuCheckBorder.Height / 3, 0
            ElseIf State = 2 Then 'Draw Custom Cell Default
                DrawDC lhDC, pMenuItem.hdc, RC, mRECT, pToolbarButton.Width, pMenuItem.Height / 2, 0
            End If
        'Case 1 'Draw Buttons MDIForm When Child Maximized
            
        Case 2 'Draw Background Popup Menu
            StretchBlt lhDC, mRECT.Left, mRECT.Top + 2, pMenuLeft.Width, mRECT.Bottom - 4, pMenuLeft.hdc, 0, 0, pMenuLeft.Width, pMenuLeft.Height, vbSrcCopy
        Case 3 'Draw Separator
            m.DrawLine lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, m.TranslateColors(vbButtonShadow)
        Case 4 ' Draw Menu Item
            If State = 0 Then 'Draw Select Menu
               DrawDC lhDC, pMenuItem.hdc, RC, mRECT, pMenuItem.Width, pMenuItem.Height / 2, 0
            Else 'Draw Select Menu Disabled
               DrawDC lhDC, pMenuItem.hdc, RC, mRECT, pMenuItem.Width, pMenuItem.Height / 2, pMenuItem.Height / 2
            End If
        Case 5 'Draw Check
            If State = 0 Then 'Draw Check
               DrawDC lhDC, pMenuCheckBorder.hdc, RC, mRECT, pMenuCheckBorder.Width, pMenuCheckBorder.Height / 3, 0
            ElseIf State = 1 Then 'Draw Check Selected
               DrawDC lhDC, pMenuCheckBorder.hdc, RC, mRECT, pMenuCheckBorder.Width, pMenuCheckBorder.Height / 3, 0
            ElseIf State = 2 Then 'Draw Check Disabled
               DrawDC lhDC, pMenuCheckBorder.hdc, RC, mRECT, pMenuCheckBorder.Width, pMenuCheckBorder.Height / 3, pMenuCheckBorder.Height / 3
            End If
        Case 6 'Draw Border Menu Popup
            m.DrawFrame lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, &H868686
        Case 7 'Draw A Line To make Fit MenuBar and Popup Menu
            m.DrawLine lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, vbWhite
        Case 8 'Return the Color Of Menu (Text and Check, Radio, etc...)
            'If State = 0 Then
            '   Selected
            'ElseIf State = 1 Then
            '   Not Selected
            'Else
            '   Disabled
            'End If
            If State = 0 Or State = 1 Then
                lReturn = vbBlack
            Else
                lReturn = vbGrayText
            End If
        Case 9 'Draw Radio Check
            If State = 0 Then 'Draw Radio Check
               DrawDC lhDC, pMenuCheckBorder.hdc, RC, mRECT, pMenuCheckBorder.Width, pMenuCheckBorder.Height / 3, 0
            ElseIf State = 1 Then 'Draw Radio Check Selected
               DrawDC lhDC, pMenuCheckBorder.hdc, RC, mRECT, pMenuCheckBorder.Width, pMenuCheckBorder.Height / 3, 0
            ElseIf State = 2 Then 'Draw Radio Check Disabled
               DrawDC lhDC, pMenuCheckBorder.hdc, RC, mRECT, pMenuCheckBorder.Width, pMenuCheckBorder.Height / 3, pMenuCheckBorder.Height / 3
            End If
            
            With mRECT
                .Left = mnLeft + 2
                .Top = mnTop + 2
                .Right = mnRight - 2
                .Bottom = mnBottom - 2
            End With
            'Draw A Ellip
            DrawDC lhDC, pMenuCheck.hdc, RC, mRECT, pMenuCheck.Width, pMenuCheck.Height / 4, pMenuCheck.Height / 4 * 2
        Case 10 'Draw Menu Color Group
            If State = 0 Then 'Color Selected
               DrawDC lhDC, pMenuCheckBorder.hdc, RC, mRECT, pMenuCheckBorder.Width, pMenuCheckBorder.Height / 3, 0
            ElseIf State = 1 Then 'Draw Custom Cell Default
                DrawDC lhDC, pMenuItem.hdc, RC, mRECT, pMenuItem.Width, pMenuItem.Height / 2, 0
            End If
        Case 11 ' Return Text Left of Menu
            lReturn = mnRight + 6
    End Select
End Sub

Public Sub ThemePropertyGrid(hwnd As Long, lhDC As Long, State As Integer, plDraw As Integer, cLeft As Long, cTop As Long, cRight As Long, cBottom As Long)
    On Error Resume Next
    Dim vitri As Long
    Dim RC As RECT
    Dim cr As RECT

    With RC
        .Left = 3
        .Top = 3
        .Right = 3
        .Bottom = 3
    End With
    
    With cr
        .Left = cLeft
        .Top = cTop
        .Right = cRight
        .Bottom = cBottom
    End With
    
    Select Case plDraw
        Case 0 'Draw Border
            Select Case State
                Case 0 'Draw Border Property
                    
                    m.DrawFrame lhDC, cLeft, cTop, cRight, cBottom, &HCF9365
                    'DrawDC lhDC, pTab.hdc, RC, cr, pTab.Width, pTab.Height, 0
                Case 1 'Draw Description Property
                    'M.DrawGradient lhDC, cLeft, cTop, cRight, cBottom, vbBlue, vbWhite, vbBlue
                    m.DrawFill lhDC, cLeft, cTop, cRight, cBottom, &HFFDBBF
                    m.DrawFrame lhDC, cLeft, cTop, cRight, cBottom, &HCF9365
                    
            End Select
        Case 1 'Draw Property
            Select Case State
                Case 0 'Draw Left Side
                    DrawDC lhDC, pTab.hdc, RC, cr, pTab.Width, pTab.Height, 0
                    'DrawDC lhDC, pButton.hdc, RC, cr, pButton.Width, pButton.Height / 5, pButton.Height / 5
                Case 1
                    m.DrawFill lhDC, cLeft, cTop, cRight, cBottom, &HFFDBBF
            End Select
    End Select
End Sub

Public Sub ThemeDate(hwnd As Long, lhDC As Long, State As Integer, plDraw As Integer, cLeft As Long, cTop As Long, cRight As Long, cBottom As Long)
    On Error Resume Next
    Dim vitri As Long
    Dim RC As RECT
    Dim cr As RECT

    With RC
        .Left = 3
        .Top = 3
        .Right = 3
        .Bottom = 3
    End With
    
    With cr
        .Left = cLeft
        .Top = cTop
        .Right = cRight
        .Bottom = cBottom
    End With
    
    Select Case plDraw
        Case 1
            Select Case State
                Case 0 'Background
                    DrawDC lhDC, pTab.hdc, RC, cr, pTab.Width, pTab.Height, 0
                Case 1 'Bar week
                    'M.DrawGradient lhDC, cLeft, cTop, cRight, cBottom, vbBlue, vbWhite, vbBlue
            End Select
        Case 2 'Draw Cell
            Select Case State
                Case 0 'Day selected
                    DrawDC lhDC, pButton.hdc, RC, cr, pButton.Width, pButton.Height / 5, pButton.Height / 5
                Case 1 'Day on month
                    'M.DrawFill lhDC, cLeft, cTop, cRight, cBottom, vbGreen
                Case 2 'Day on last month
                    'M.DrawFill lhDC, cLeft, cTop, cRight, cBottom, vbRed
                Case 3 'Day on next month
                    'M.DrawFill lhDC, cLeft, cTop, cRight, cBottom, vbCyan
            End Select
    End Select
End Sub

Public Sub ThemeSpinButton(lhDC As Long, State As Integer, sButton As Integer, X As Long, Y As Long, X1 As Long, Y1 As Long)
    On Error Resume Next
    Dim vitri As Integer
    Dim RC As RECT
    Dim cr As RECT
    
    With RC
        .Left = 2
        .Top = 2
        .Right = 2
        .Bottom = 2
    End With
    
    With cr
        .Left = X
        .Top = Y
        .Right = X1
        .Bottom = Y1
    End With
    
    Select Case sButton
        Case 1, 3 'Button Top
            Select Case State  '= 2 Then
                Case 1 'Normal
                    vitri = 0
                Case 2 ' Move Hot
                    vitri = 1
                Case 3 'Press
                    vitri = 2
                Case 4 'Disabled
                    vitri = 3
                Case 5 'Forcus
                    vitri = 0
            End Select
        Case 2, 4 'Button Down
            Select Case State  '= 2 Then
                Case 1 'Normal
                    vitri = 4
                Case 2 ' Move Hot
                    vitri = 5
                Case 3 'Press
                    vitri = 6
                Case 4 'Disabled
                    vitri = 7
                Case 5 'Forcus
                    vitri = 4
            End Select
    End Select
    If sButton = 1 Or sButton = 2 Then
        DrawDC lhDC, pSpinVer.hdc, RC, cr, pSpinVer.Width, pSpinVer.Height / 8, pSpinVer.Height / 8 * vitri
    Else
        DrawDC lhDC, pSpinHor.hdc, RC, cr, pSpinHor.Width, pSpinHor.Height / 8, pSpinHor.Height / 8 * vitri
    End If
    If sButton = 1 Then
        TransparentBlt lhDC, cr.Left + ((cr.Right - cr.Left) / 2 - 4), cr.Top + ((cr.Bottom - cr.Top) / 2 - 4), 9, 9, pArrow.hdc, 0, 0, pArrow.Width, pArrow.Height / 20, 16711935
    ElseIf sButton = 2 Then
        TransparentBlt lhDC, cr.Left + ((cr.Right - cr.Left) / 2 - 4), cr.Top + ((cr.Bottom - cr.Top) / 2 - 4), 9, 9, pArrow.hdc, 0, pArrow.Height / 20 * 4, pArrow.Width, pArrow.Height / 20, 16711935
    ElseIf sButton = 3 Then
        TransparentBlt lhDC, cr.Left + ((cr.Right - cr.Left) / 2 - 4), cr.Top + ((cr.Bottom - cr.Top) / 2 - 4), 9, 9, pArrow.hdc, 0, pArrow.Height / 20 * 12, pArrow.Width, pArrow.Height / 20, 16711935
    ElseIf sButton = 4 Then
        TransparentBlt lhDC, cr.Left + ((cr.Right - cr.Left) / 2 - 4), cr.Top + ((cr.Bottom - cr.Top) / 2 - 4), 9, 9, pArrow.hdc, 0, pArrow.Height / 20 * 8, pArrow.Width, pArrow.Height / 20, 16711935
    End If
End Sub

Public Sub DrawTextbox(ByVal hwnd As Long, ByVal lhDC As Long, ByVal bState As Integer, ByVal X As Long, ByVal Y As Long, ByVal Width As Long, ByVal Height As Long)
    On Error Resume Next
    Select Case bState
        Case 0
            m.DrawFrame lhDC, X, Y, Width, Height, &HCF9365
        Case 1
            m.DrawFrame lhDC, X, Y, Width, Height, vbBlue ' &HCF9365
    End Select
End Sub

Public Sub ThemeTrackbar(hwnd As Long, lhDC As Long, bEnable As Boolean, Hot As Boolean, Ticks As TickStyle, plDraw As Integer, cOrientation As OrientationConst, X1 As Long, Y1 As Long, x2 As Long, y2 As Long)
    On Error Resume Next
   
    Dim vitri As Integer
    Dim RC As RECT
    Dim cr As RECT
    
    With RC
        .Left = 3
        .Top = 6
        .Right = 3
        .Bottom = 10
    End With
    
    With cr
        .Left = X1
        .Top = Y1
        .Right = x2
        .Bottom = y2
    End With
    
    Select Case plDraw
        Case 0  'Draw Back Bar
            m.DrawFill lhDC, cr.Left, cr.Top, cr.Right, cr.Bottom, vbButtonFace
            m.DrawEdge lhDC, cr.Left, cr.Top, cr.Right, cr.Bottom, BDR_SUNKENOUTER, BF_RECT
        Case 1
            If Ticks = 0 Then
                If cOrientation = 0 Then
                    DrawDCTransparent lhDC, pTrackBarVerTop.hdc, RC, cr, pTrackBarVerTop.Width, pTrackBarVerTop.Height / 3, IIf(bEnable = False, pTrackBarVerTop.Height / 3 * 2, IIf(Hot = False, 0, pTrackBarVerTop.Height / 3)), 16711935
                Else
                    DrawDCTransparent lhDC, pTrackBarHorLeft.hdc, RC, cr, pTrackBarHorLeft.Width, pTrackBarHorLeft.Height / 3, IIf(bEnable = False, pTrackBarHorLeft.Height / 3 * 2, IIf(Hot = False, 0, pTrackBarHorLeft.Height / 3)), 16711935
                End If
            ElseIf Ticks = 1 Then
                If cOrientation = 0 Then
                    DrawDCTransparent lhDC, pTrackBarVerBottom.hdc, RC, cr, pTrackBarVerBottom.Width, pTrackBarVerBottom.Height / 3, IIf(bEnable = False, pTrackBarVerBottom.Height / 3 * 2, IIf(Hot = False, 0, pTrackBarVerBottom.Height / 3)), 16711935
                Else
                    DrawDCTransparent lhDC, pTrackBarHorRight.hdc, RC, cr, pTrackBarHorRight.Width, pTrackBarHorRight.Height / 3, IIf(bEnable = False, pTrackBarHorRight.Height / 3 * 2, IIf(Hot = False, 0, pTrackBarHorRight.Height / 3)), 16711935
                End If
            ElseIf Ticks = 2 Then
                If cOrientation = 0 Then
                    DrawDCTransparent lhDC, pTrackBarVerBold.hdc, RC, cr, pTrackBarVerBold.Width, pTrackBarVerBold.Height / 3, IIf(bEnable = False, pTrackBarVerBold.Height / 3 * 2, IIf(Hot = False, 0, pTrackBarVerBold.Height / 3)), 16711935
                Else
                    DrawDCTransparent lhDC, pTrackBarHorBold.hdc, RC, cr, pTrackBarHorBold.Width, pTrackBarHorBold.Height / 3, IIf(bEnable = False, pTrackBarHorBold.Height / 3 * 2, IIf(Hot = False, 0, pTrackBarHorBold.Height / 3)), 16711935
                End If
            End If
    End Select
End Sub

Public Sub ThemeScroll(ByVal lhWnd As Long, ByVal lhDC As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal ePart As sbOnPaintPartCts, ByVal eState As sbOnPaintPartStateCts, ByVal sVertical As Boolean)
    On Error Resume Next
   
    Dim vitri As Integer
    Dim RC As RECT
    Dim cr As RECT
    
    
    With RC
        .Left = 5
        .Top = 5
        .Right = 5
        .Bottom = 5
    End With
    
    With cr
        .Left = X1
        .Top = Y1
        .Right = x2
        .Bottom = y2
    End With
    
    Select Case ePart
        Case 0, 1
            'Draw 2 Button Top and Bottom
            If sVertical = False Then
                If ePart = 0 Then 'Up Button
                    Select Case eState
                        Case ppsNormal
                            If MDMouseOver(lhWnd) Then
                                vitri = 16
                            Else
                                vitri = 0
                            End If
                        Case ppsPressed
                            vitri = 2
                        Case ppsHot
                            vitri = 1
                        Case ppsDisabled
                            vitri = 3
                    End Select
                ElseIf ePart = 1 Then 'Down Button
                    Select Case eState
                        Case ppsNormal
                            If MDMouseOver(lhWnd) Then
                                vitri = 17
                            Else
                                vitri = 4
                            End If
                        Case ppsPressed
                            vitri = 6
                        Case ppsHot
                            vitri = 5
                        Case ppsDisabled
                            vitri = 7
                    End Select
                End If
            Else
                If ePart = 0 Then
                    Select Case eState
                        Case ppsNormal
                            If MDMouseOver(lhWnd) Then
                                vitri = 18
                            Else
                                vitri = 8
                            End If
                        Case ppsPressed
                            vitri = 10
                        Case ppsHot
                            vitri = 9
                        Case ppsDisabled
                            vitri = 11
                    End Select
                Else
                    Select Case eState
                        Case ppsNormal
                            If MDMouseOver(lhWnd) Then
                                vitri = 19
                            Else
                                vitri = 12
                            End If
                        Case ppsPressed
                            vitri = 14
                        Case ppsHot
                            vitri = 13
                        Case ppsDisabled
                            vitri = 15
                    End Select
                End If
            End If
            
            DrawDC lhDC, pScrollButton.hdc, RC, cr, pScrollButton.Width, pScrollButton.Height / 20, pScrollButton.Height / 20 * vitri
            TransparentBlt lhDC, cr.Left + ((cr.Right - cr.Left) / 2 - 4), cr.Top + ((cr.Bottom - cr.Top) / 2 - 4), 9, 9, pArrow.hdc, 0, pArrow.Height / 20 * vitri, pArrow.Width, pArrow.Height / 20, 16711935
        Case 2, 3 'Draw Bar Top and Bottom
            If sVertical = False Then
                With RC
                    .Left = 5
                    .Top = 0
                    .Right = 5
                    .Bottom = 0
                End With
                If eState = ppsNormal Then
                    vitri = pScrollButton.Height / 20 * 3
                ElseIf eState = ppsPressed Then
                    vitri = pScrollButton.Height / 20 * 3
                End If
            Else
                With RC
                    .Left = 0
                    .Top = 5
                    .Right = 0
                    .Bottom = 5
                End With
                If eState = ppsNormal Then
                    vitri = pScrollButton.Height / 20 * 8
                ElseIf eState = ppsPressed Then
                    vitri = pScrollButton.Height / 20 * 8
                End If
            End If
            
            DrawDC lhDC, pScrollButton.hdc, RC, cr, pScrollButton.Width, pScrollButton.Height / 20, vitri
        Case 4
           If eState = ppsNormal Then
              m.DrawFill lhDC, X1, Y1, x2, y2, vbButtonFace
              m.DrawFrame lhDC, X1, Y1, x2, y2, vbButtonShadow
           ElseIf eState = ppsPressed Then
              m.DrawFill lhDC, X1, Y1, x2, y2, m.ColorToRGB(&HEDD0BF, 0, 0, 0, -20)
              m.DrawFrame lhDC, X1, Y1, x2, y2, m.TranslateColors(&HC56A31)
           ElseIf eState = ppsHot Then
              m.DrawFill lhDC, X1, Y1, x2, y2, m.TranslateColors(&HEDD0BF)
              m.DrawFrame lhDC, X1, Y1, x2, y2, m.TranslateColors(&HC56A31)
           End If
        Case 5  ' Thumb
            If sVertical = False Then
                If eState = ppsNormal Then
                    vitri = 0
                ElseIf eState = ppsPressed Then
                    vitri = pScrollThumbVer.Height / 4 * 2
                ElseIf eState = ppsHot Then
                    vitri = pScrollThumbVer.Height / 4
                ElseIf eState = ppsDisabled Then
                    vitri = pScrollThumbVer.Height / 4 * 3
                End If
                DrawDC lhDC, pScrollThumbVer.hdc, RC, cr, pScrollThumbVer.Width, pScrollThumbVer.Height / 4, vitri
            Else
                If eState = ppsNormal Then
                    vitri = 0
                ElseIf eState = ppsPressed Then
                    vitri = pScrollThumbHor.Height / 4 * 2
                ElseIf eState = ppsHot Then
                    vitri = pScrollThumbHor.Height / 4
                ElseIf eState = ppsDisabled Then
                    vitri = pScrollThumbHor.Height / 4 * 3
                End If
                DrawDC lhDC, pScrollThumbHor.hdc, RC, cr, pScrollThumbHor.Width, pScrollThumbHor.Height / 4, vitri
            End If
    End Select
End Sub

Public Sub ThemeListbox(ByVal hwnd As Long, ByVal lhDC As Long, ByVal plDraw As Long, ByVal cLeft As Long, ByVal cTop As Long, ByVal cRight As Long, ByVal cBottom As Long)
    On Error Resume Next
    
    Dim RC As RECT
    Dim cr As RECT

    With RC
        .Left = 3
        .Top = 3
        .Right = 3
        .Bottom = 3
    End With
    
    With cr
        .Left = cLeft
        .Top = cTop
        .Right = cRight
        .Bottom = cBottom
    End With
    
    Dim m_Caption As String
    m_Caption = PtrStr(hwnd)
    If plDraw = 0 Then
        m.DrawFrame lhDC, cLeft, cTop, cRight, cBottom, &HB07D56
    ElseIf plDraw = 1 Then 'Draw item selected
        DrawDC lhDC, pButton.hdc, RC, cr, pButton.Width, pButton.Height / 5, pButton.Height / 5
        m.DrawTextSupport lhDC, m_Caption, UserControl.Font, cLeft + 26, cTop, cRight, cBottom, vbBlack, , , DT_CENTER & DT_EXPANDTABS
    ElseIf plDraw = 2 Then  'Draw item not select
        m.DrawTextSupport lhDC, m_Caption, UserControl.Font, cLeft + 26, cTop, cRight, cBottom, vbBlack, , , DT_CENTER & DT_EXPANDTABS
    End If
End Sub

Public Sub ThemeStatusBar(handle As Long, lhDC As Long, plDraw As Integer, X As Long, Y As Long, X1 As Long, Y1 As Long, Optional MyObj As Object)
    On Error Resume Next
    Dim lWidthLeft As Long
    
    
    Dim vitri As Integer
    Dim RC As RECT
    Dim cr As RECT
    
    With RC
        .Left = 0
        .Top = 3
        .Right = 0
        .Bottom = 3
    End With
    
    With cr
        .Left = X
        .Top = Y
        .Right = X1
        .Bottom = Y1
    End With
    
    Select Case plDraw
        Case 0
            DrawDC lhDC, pStatusBar.hdc, RC, cr, pStatusBar.Width, pStatusBar.Height / 4, 0
            With cr
                .Left = X1 - 30
                .Top = Y
                .Right = X1
                .Bottom = Y1
            End With
            DrawDC lhDC, pStatusBar.hdc, RC, cr, pStatusBar.Width, pStatusBar.Height / 4, pStatusBar.Height / 4 * 3
            StretchBlt lhDC, cr.Left - 3, 0, 3, cr.Bottom + 2, pStatusBar.hdc, 0, 44, 3, 22, vbSrcCopy
        Case 1
            m.DrawThemes "Status", hwnd, lhDC, X, Y, X1, Y1, 3, 1
        Case 2 'Draw Separator
            StretchBlt lhDC, X, Y, pStatusBar.Width, pStatusBar.Height / 4, pStatusBar.hdc, 0, pStatusBar.Height / 4, pStatusBar.Width, pStatusBar.Height / 4, vbSrcCopy
            'DrawDC lHDC, pStatusBar.hdc, rc, cr, pStatusBar.Width, pStatusBar.Height / 4, pStatusBar.Height / 4
        Case 3
            ThemeProgress handle, lhDC, 0, X1 - 5, Y1, X - 5, Y - 2, 0, Y1 + 1
        Case 4
            ThemeProgress handle, lhDC, 0, 0, 0, X - 8, Y - 5, X1, Y1 + 3
        Case 5 'Draw item
            Dim mObj As UniStatusBar
            Set mObj = MyObj
            If mObj.PanelAlign(handle) = pnRight Then
                With cr
                    .Left = X
                    .Right = X1 + 14
                    .Top = Y - 2
                    .Bottom = Y1 + 2
                End With
                DrawDC lhDC, pStatusBar.hdc, RC, cr, pStatusBar.Width, pStatusBar.Height / 4, pStatusBar.Height / 4 * 3
                StretchBlt lhDC, X - 3, Y - 2, 3, Y1 + 2, pStatusBar.hdc, 0, 44, 3, 22, vbSrcCopy
            End If
            m.DrawTextSupport lhDC, mObj.PanelText(handle), mObj.Font, X, Y, X1, Y1, IIf(mObj.PanelValue(handle) = 0, vbBlack, vbGrayText), , , DT_VCENTER & &H15
    End Select
End Sub

Public Sub ThemeTab(ByVal handle As Long, ByVal lhDC As Long, ByVal plDraw As Integer, ByVal State As Integer, ByVal cLeft As Long, ByVal cTop As Long, ByVal cRight As Long, ByVal cBottom As Long, ByVal sPosition As Integer)
    On Error Resume Next
    Dim vitri As Integer
    Dim RC As RECT
    Dim cr As RECT
    
    With cr
        .Left = cLeft
        .Top = cTop
        .Right = cRight
        .Bottom = cBottom
    End With
    If sPosition = 0 Then
        Select Case plDraw
            Case 0
               'Draw Border Tab
                With RC
                    .Left = 5
                    .Top = 5
                    .Right = 5
                    .Bottom = 5
                End With
                DrawDC lhDC, pTab.hdc, RC, cr, pTab.Width, pTab.Height, 0
            Case 1
                With RC
                    .Left = 6
                    .Top = 6
                    .Right = 6
                    .Bottom = 6
                End With
                Select Case State
                    Case 0
                        vitri = 0
                    Case 1
                        vitri = pTabTop.Height / 5
                    Case 2
                        vitri = pTabTop.Height / 5 * 2
                    Case 3
                        vitri = pTabTop.Height / 5 * 4
                End Select
                DrawDC lhDC, pTabTop.hdc, RC, cr, pTabTop.Width, pTabTop.Height / 5, vitri
               'State = 0 Draw Tab Not Selected
               'State = 1 Draw Tab Move Hot
               'State = 2 Draw Tab Selected
               'State = 2 Draw Tab Selected Move Hot
        End Select
    End If
End Sub

Public Sub DrawListview(ByVal lhWnd As Long, ByVal lhDC As Long, ByVal plDraw As Integer, ByVal State As Integer, ByVal X As Long, ByVal Y As Long, ByVal X1 As Long, ByVal Y1 As Long)
    On Error Resume Next
    Dim vitri As Integer
    Dim RC As RECT
    Dim cr As RECT
    
    
    With RC
        .Left = 3
        .Top = 3
        .Right = 3
        .Bottom = 3
    End With
    
    With cr
        .Left = X
        .Top = Y
        .Right = X1
        .Bottom = Y1
    End With
    
    Select Case plDraw
        Case 0 'Draw Header Panel
            If State = 1 Then
                vitri = 0
            ElseIf State = 2 Then  'Move Hot
                vitri = pListView.Height / 5 * 2
            ElseIf State = 3 Then
                vitri = pListView.Height / 5
            ElseIf State = 0 Then
                vitri = pListView.Height / 5 * 3
            End If
            DrawDC lhDC, pListView.hdc, RC, cr, pListView.Width, pListView.Height / 5, vitri
        Case 1 'Draw Header
            DrawDC lhDC, pListView.hdc, RC, cr, pListView.Width, pListView.Height / 5, 0
        Case 2 'Draw Border
            m.DrawFrame lhDC, X, Y, X1, Y1, &HCF9365
    End Select
End Sub

Public Sub ThemeCombobox(ByVal hwnd As Long, ByVal lhDC As Long, ByVal State As Integer, ByVal plDraw As Integer, ByVal cLeft As Long, ByVal cTop As Long, ByVal cRight As Long, ByVal cBottom As Long)
    On Error Resume Next
    Dim vitri As Integer
    Dim RC As RECT
    Dim cr As RECT
    
    With RC
        .Left = 3
        .Top = 3
        .Right = 3
        .Bottom = 3
    End With
    
    With cr
        .Left = cLeft - 2
        .Top = cTop
        .Right = cRight
        .Bottom = cBottom - 1
    End With
    
    If plDraw = 0 Then
        'Draw Border
        Select Case State
            Case 0      'Background and Border
                m.DrawFill lhDC, cLeft, cTop, cRight, cBottom, vbWindowBackground
                m.DrawFrame lhDC, cLeft, cTop, cRight, cBottom, &HCF9365
            Case 1      ' Draw Backbar highlight
                m.DrawFill lhDC, cLeft, cTop, cRight, cBottom, vbHighlight
            Case 2      'Draw Text
                m.DrawText lhDC, PtrStr(hwnd), cLeft, cTop + 2, cRight - 2, cBottom - 2, DT_LEFT
            Case 3      ' Draw Background and Border GetForcus
                m.DrawFill lhDC, cLeft, cTop, cRight, cBottom, vbWindowBackground
                m.DrawFrame lhDC, cLeft, cTop, cRight, cBottom, vbBlue
        End Select
    ElseIf plDraw = 1 Then
        'Draw Button DropDown
        If State = 2 Then ' Move Hot
            vitri = 1
        ElseIf (State = 1) Or (State = 5) Then 'Normal
            vitri = 0
            'ElseIf (State = 5) Then
            'vitri = pButton.Height / 5 * 4
        ElseIf State = 3 Then 'Press
            vitri = 2
        ElseIf State = 4 Then 'Disabled
            vitri = 3
        End If
        DrawDC lhDC, pCombobox.hdc, RC, cr, pCombobox.Width, pCombobox.Height / 4, pCombobox.Height / 4 * vitri
        TransparentBlt lhDC, cr.Left + ((cr.Right - cr.Left) / 2 - 4), cr.Top + ((cr.Bottom - cr.Top) / 2 - 4), 9, 9, pArrow.hdc, 0, pArrow.Height / 20 * 4, pArrow.Width, pArrow.Height / 20, 16711935
    ElseIf plDraw = 2 Then
        'Draw List
        If State = 0 Then
            DrawDC lhDC, pButton.hdc, RC, cr, pButton.Width, pButton.Height / 5, pButton.Height / 5
        ElseIf State = 1 Then
            'M.DrawFill lHDC, cLeft + 3, cTop + 2, cLeft + 15, cBottom - 2, M.TranslateColors(PtrStr(hwnd))
        End If
        m.DrawTextSupport lhDC, PtrStr(hwnd), UserControl.Font, cLeft + 25, cTop, cRight, cBottom, vbBlack, , , 0
    End If
End Sub

Public Sub ThemeFrame(ByVal hwnd As Long, ByVal lhDC As Long, ByVal cLeft As Long, ByVal cTop As Long, ByVal cRight As Long, ByVal cBottom As Long)
    m.DrawFrame lhDC, cLeft + 1, cTop + 1, cRight, cBottom, vbWhite
    m.DrawFrame lhDC, cLeft, cTop, cRight - 1, cBottom - 1, &HCF9365
End Sub

Public Sub ThemeButton(ByVal hwnd As Long, ByVal lhDC As Long, ByVal State As Integer, ByVal bFocus As Boolean, ByVal bHotMove As Boolean, ByVal cLeft As Long, ByVal cTop As Long, ByVal cRight As Long, ByVal cBottom As Long)
    On Error Resume Next
    Dim vitri As Integer
    Dim RC As RECT
    Dim cr As RECT
    
    If State = 2 Then ' Move Hot
        vitri = pButton.Height / 5
    ElseIf (State = 1) Then  'Normal
        vitri = 0
    ElseIf (State = 5) Then
        vitri = pButton.Height / 5 * 4
    ElseIf State = 3 Then 'Press
        vitri = pButton.Height / 5 * 2
    ElseIf State = 4 Then 'Disabled
        vitri = pButton.Height / 5 * 3
    End If
    
    With RC
        .Left = 3
        .Top = 3
        .Right = 3
        .Bottom = 3
    End With
    
    With cr
        .Left = cLeft
        .Top = cTop
        .Right = cRight
        .Bottom = cBottom
    End With
    DrawDC lhDC, pButton.hdc, RC, cr, pButton.Width, pButton.Height / 5, vitri
End Sub


Public Sub ThemeProgress(ByVal handle As Long, ByVal lhDC As Long, ByVal plDraw As Integer, ByVal pgWidth As Long, ByVal pgHeight As Long, ByVal cLeft As Long, ByVal cTop As Long, ByVal cRight As Long, ByVal cBottom As Long)
    On Error Resume Next
    Dim RC As RECT, cr As RECT
    
    If plDraw = 0 Then 'Horizotal
        If pgWidth > 0 Then
            With cr
                .Left = cLeft
                .Top = cTop
                .Right = pgWidth
                .Bottom = pgHeight
            End With
            With RC
                .Left = 2
                .Top = 2
                .Right = 2
                .Bottom = 2
            End With
            DrawDC lhDC, pProgress.hdc, RC, cr, 53, 18, 0
        End If
        If cRight > 0 Then
            With cr
                .Left = cLeft + 2
                .Top = cTop + 2
                .Right = cRight - 2
                .Bottom = cBottom - 2
            End With
            
            With RC
                .Left = 2
                .Top = 6
                .Right = 2
                .Bottom = 5
            End With
            
            DrawDC lhDC, pProgress.hdc, RC, cr, 125, 16, 18
        End If
    Else
       'Vertical
        If pgHeight > 0 Then
            With cr
                .Left = cLeft
                .Top = cTop
                .Right = pgWidth
                .Bottom = pgHeight
            End With
            With RC
                .Left = 2
                .Top = 2
                .Right = 2
                .Bottom = 2
            End With
            DrawDC lhDC, pProgressHor.hdc, RC, cr, 18, 53, 0
        End If
        If cBottom > 0 Then
            With cr
                .Left = cLeft + 2
                .Top = cTop + 2
                .Right = cRight - 2
                .Bottom = cBottom - 2
            End With
            
            With RC
                .Left = 2
                .Top = 6
                .Right = 2
                .Bottom = 5
            End With
            
            DrawDC lhDC, pProgressHor.hdc, RC, cr, 16, 51, 53
        End If
    End If
End Sub

Private Sub DrawDC(ByVal DesDC As Long, ByVal SrcDC As Long, RC As RECT, cr As RECT, ByVal lWidth As Long, ByVal lHeight As Long, ByVal vitri As Long)
    SetStretchBltMode DesDC, 4
    'LeftTop
    StretchBlt DesDC, cr.Left, cr.Top, RC.Left, RC.Top, SrcDC, 0, vitri, RC.Left, RC.Top, vbSrcCopy
    'RightTop
    StretchBlt DesDC, cr.Right - RC.Left, cr.Top, RC.Left, RC.Top, SrcDC, lWidth - RC.Left, vitri, RC.Left, RC.Top, vbSrcCopy
    'LeftBottom
    StretchBlt DesDC, cr.Left, cr.Bottom - RC.Bottom, RC.Right, RC.Bottom, SrcDC, 0, vitri + lHeight - RC.Bottom, RC.Right, RC.Bottom, vbSrcCopy
    'RightBottom
    StretchBlt DesDC, cr.Right - RC.Right, cr.Bottom - RC.Bottom, RC.Right, RC.Bottom, SrcDC, lWidth - RC.Right, vitri + lHeight - RC.Bottom, RC.Right, RC.Bottom, vbSrcCopy
    
    'Top
    StretchBlt DesDC, cr.Left + RC.Left, cr.Top, cr.Right - RC.Left - RC.Right - cr.Left, RC.Top, SrcDC, RC.Left, vitri, lWidth - RC.Left - RC.Right, RC.Top, vbSrcCopy
    'Left
    StretchBlt DesDC, cr.Left, cr.Top + RC.Top, RC.Left, cr.Bottom - RC.Top - RC.Bottom - cr.Top, SrcDC, 0, vitri + RC.Top, RC.Left, lHeight - RC.Top - RC.Bottom, vbSrcCopy
    'Right
    StretchBlt DesDC, cr.Right - RC.Left, cr.Top + RC.Top, RC.Right, cr.Bottom - cr.Top - RC.Top - RC.Bottom, SrcDC, lWidth - RC.Right, vitri + RC.Top, RC.Right, lHeight - RC.Top - RC.Bottom, vbSrcCopy
    'Bottom
    StretchBlt DesDC, cr.Left + RC.Left, cr.Bottom - RC.Bottom, cr.Right - RC.Left - RC.Right - cr.Left, RC.Bottom, SrcDC, RC.Left, vitri + lHeight - RC.Bottom, lWidth - RC.Left - RC.Right, RC.Bottom, vbSrcCopy
    
    'Center
    StretchBlt DesDC, cr.Left + RC.Left, cr.Top + RC.Top, cr.Right - RC.Left - RC.Right - cr.Left, cr.Bottom - RC.Top - RC.Bottom - cr.Top, SrcDC, RC.Left, vitri + RC.Top, lWidth - RC.Left - RC.Right, lHeight - RC.Top - RC.Bottom, vbSrcCopy
End Sub

Private Sub DrawDCTransparent(ByVal DesDC As Long, ByVal SrcDC As Long, RC As RECT, cr As RECT, ByVal lWidth As Long, ByVal lHeight As Long, ByVal vitri As Long, Optional ByVal TransColor As Long = 16711935)
    SetStretchBltMode DesDC, 4
    'LeftTop
    TransparentBlt DesDC, cr.Left, cr.Top, RC.Left, RC.Top, SrcDC, 0, vitri, RC.Left, RC.Top, TransColor
    'RightTop
    TransparentBlt DesDC, cr.Right - RC.Left, cr.Top, RC.Left, RC.Top, SrcDC, lWidth - RC.Left, vitri, RC.Left, RC.Top, TransColor
    'LeftBottom
    TransparentBlt DesDC, cr.Left, cr.Bottom - RC.Bottom, RC.Right, RC.Bottom, SrcDC, 0, vitri + lHeight - RC.Bottom, RC.Right, RC.Bottom, TransColor
    'RightBottom
    TransparentBlt DesDC, cr.Right - RC.Right, cr.Bottom - RC.Bottom, RC.Right, RC.Bottom, SrcDC, lWidth - RC.Right, vitri + lHeight - RC.Bottom, RC.Right, RC.Bottom, TransColor
    
    'Top
    TransparentBlt DesDC, cr.Left + RC.Left, cr.Top, cr.Right - RC.Left - RC.Right - cr.Left, RC.Top, SrcDC, RC.Left, vitri, lWidth - RC.Left - RC.Right, RC.Top, TransColor
    'Left
    TransparentBlt DesDC, cr.Left, cr.Top + RC.Top, RC.Left, cr.Bottom - RC.Top - RC.Bottom - cr.Top, SrcDC, 0, vitri + RC.Top, RC.Left, lHeight - RC.Top - RC.Bottom, TransColor
    'Right
    TransparentBlt DesDC, cr.Right - RC.Left, cr.Top + RC.Top, RC.Right, cr.Bottom - cr.Top - RC.Top - RC.Bottom, SrcDC, lWidth - RC.Right, vitri + RC.Top, RC.Right, lHeight - RC.Top - RC.Bottom, TransColor
    'Bottom
    TransparentBlt DesDC, cr.Left + RC.Left, cr.Bottom - RC.Bottom, cr.Right - RC.Left - RC.Right - cr.Left, RC.Bottom, SrcDC, RC.Left, vitri + lHeight - RC.Bottom, lWidth - RC.Left - RC.Right, RC.Bottom, TransColor
    
    'Center
    TransparentBlt DesDC, cr.Left + RC.Left, cr.Top + RC.Top, cr.Right - RC.Left - RC.Right - cr.Left, cr.Bottom - RC.Top - RC.Bottom - cr.Top, SrcDC, RC.Left, vitri + RC.Top, lWidth - RC.Left - RC.Right, lHeight - RC.Top - RC.Bottom, TransColor
End Sub

Public Sub ThemeCheck(ByVal hwnd As Long, ByVal lhDC As Long, ByVal State As Integer, ByVal plDraw As Integer, ByVal cLeft As Long, ByVal cTop As Long, ByVal cRight As Long, ByVal cBottom As Long)
    If plDraw = 0 Then
        StretchBlt lhDC, cLeft, cTop, 13, 13, pCheck.hdc, 0, (State - 1) * 13, 13, 13, vbSrcCopy
    End If
End Sub

Public Sub ThemeOption(ByVal hwnd As Long, ByVal lhDC As Long, ByVal State As Integer, ByVal plDraw As Integer, ByVal cLeft As Long, ByVal cTop As Long, ByVal cRight As Long, ByVal cBottom As Long)
    If plDraw = 0 Then
        TransparentBlt lhDC, cLeft, cTop, 13, 13, pOption.hdc, 0, (State - 1) * 13, 13, 13, 16711935
    ElseIf plDraw = 1 Then
        TransparentBlt lhDC, cLeft, cTop, 13, 13, pOption.hdc, 0, (State - 1) * 13, 13, 13, 16711935
    End If
End Sub

Private Sub DrawGDIP(ByVal lhDC As Long, ByVal G As GDIPlus, RC As RECT, cr As RECT, ByVal lWidth As Long, ByVal lHeight As Long, ByVal vitri As Long)
    'LeftTop
    G.CreateGraphicsFromHDC lhDC, 2
    G.GraphicsDrawImage cr.Left, cr.Top, RC.Left, RC.Top, 0, vitri, RC.Left, RC.Top
    G.DestroyGraphics
    'RightTop
    G.CreateGraphicsFromHDC lhDC, 2
    G.GraphicsDrawImage cr.Right - RC.Left, cr.Top, RC.Left, RC.Top, lWidth - RC.Left, vitri, RC.Left, RC.Top
    G.DestroyGraphics
    'LeftBottom
    G.CreateGraphicsFromHDC lhDC, 2
    G.GraphicsDrawImage cr.Left, cr.Bottom - RC.Bottom, RC.Right, RC.Bottom, 0, vitri + lHeight - RC.Bottom, RC.Right, RC.Bottom
    G.DestroyGraphics
    'RightBottom
    G.CreateGraphicsFromHDC lhDC, 2
    G.GraphicsDrawImage cr.Right - RC.Right, cr.Bottom - RC.Bottom, RC.Right, RC.Bottom, lWidth - RC.Right, vitri + lHeight - RC.Bottom, RC.Right, RC.Bottom
    G.DestroyGraphics
    
    'Top
    G.CreateGraphicsFromHDC lhDC, 2
    G.GraphicsDrawImage cr.Left + RC.Left, cr.Top, cr.Right - RC.Left - RC.Right - cr.Left, RC.Top, RC.Left, vitri, lWidth - RC.Left - RC.Right, RC.Top
    G.DestroyGraphics
    'Left
    G.CreateGraphicsFromHDC lhDC, 2
    G.GraphicsDrawImage cr.Left, cr.Top + RC.Top, RC.Left, cr.Bottom - RC.Top - RC.Bottom - cr.Top, 0, vitri + RC.Top, RC.Left, lHeight - RC.Top - RC.Bottom
    G.DestroyGraphics
    'Right
    G.CreateGraphicsFromHDC lhDC, 2
    G.GraphicsDrawImage cr.Right - RC.Left, cr.Top + RC.Top, RC.Right, cr.Bottom - cr.Top - RC.Top - RC.Bottom, lWidth - RC.Right, vitri + RC.Top, RC.Right, lHeight - RC.Top - RC.Bottom
    G.DestroyGraphics
    'Bottom
    G.CreateGraphicsFromHDC lhDC, 2
    G.GraphicsDrawImage cr.Left + RC.Left, cr.Bottom - RC.Bottom, cr.Right - RC.Left - RC.Right - cr.Left, RC.Bottom, RC.Left, vitri + lHeight - RC.Bottom, lWidth - RC.Left - RC.Right, RC.Bottom
    G.DestroyGraphics
    
    'Center
    G.CreateGraphicsFromHDC lhDC, 2
    G.GraphicsDrawImage cr.Left + RC.Left, cr.Top + RC.Top, cr.Right - RC.Left - RC.Right - cr.Left, cr.Bottom - RC.Top - RC.Bottom - cr.Top, RC.Left, vitri + RC.Top, lWidth - RC.Left - RC.Right, lHeight - RC.Top - RC.Bottom
    G.DestroyGraphics
End Sub


Public Sub ThemeUniToolbar(ByVal hwnd As Long, ByVal lhDC As Long, ByVal plDraw As Integer, ByVal ItemIndex As Long, ByVal ItemLeft As Long, ByVal ItemTop As Long, ByVal ItemWidth As Long, ByVal ItemHeight As Long, ByVal tbStatus As Long, ByVal tbWidth As Long, ByVal tbHeight As Long, ByVal tbME As Object, Optional lReturn As Variant)
    Dim mRECT As RECT, ItemRECT As RECT
    Dim RC As RECT
    On Error Resume Next
    With mRECT
       .Left = 0
       .Top = 0
       .Right = tbWidth
       .Bottom = tbHeight
    End With
    
    With RC
       .Left = 3
       .Top = 3
       .Right = 3
       .Bottom = 3
    End With
    
    With ItemRECT
       .Left = ItemLeft
       .Top = ItemTop + 2
       .Right = ItemWidth
       .Bottom = ItemHeight
    End With
    
    Select Case plDraw
        Case 0 'Draw Background
            With RC
               .Left = 3
               .Top = 3
               .Right = 3
               .Bottom = 16
            End With
            
            If tbME.DrawBackground = False Then
                RC.Bottom = 3
                tbME.ButtonHeight = tbHeight
                DrawDC lhDC, pTab.hdc, RC, mRECT, pTab.Width, pTab.Height, 0
                'M.DrawFill lhDC, 0, 0, tbWidth, tbHeight, M.TranslateColors(vbButtonFace)
            Else
                'M.DrawFill lhDC, 0, 0, tbWidth, tbHeight, M.TranslateColors(&H80000016)
                tbME.ButtonHeight = tbHeight - 16
                DrawDC lhDC, pToolbar.hdc, RC, mRECT, pToolbar.Width, pToolbar.Height, 0
            End If
            
            If tbME.ShowRebar Then
               'Draw ReBar
               Dim i As Integer
               For i = 0 To Fix((tbHeight - 12) / 2)
                   m.DrawLine lhDC, 3, i * 2 + 5, 6, i * 2 + 5, m.TranslateColors(vbButtonShadow)
               Next i
            End If
        Case 1
            'Draw Item Check Not Select
            DrawDCTransparent lhDC, pToolbarButton.hdc, RC, ItemRECT, pToolbarButton.Width, pToolbarButton.Height / 5, pToolbarButton.Height / 5 * 3
        Case 2
            'Draw Item Check Selected
            DrawDCTransparent lhDC, pToolbarButton.hdc, RC, ItemRECT, pToolbarButton.Width, pToolbarButton.Height / 5, pToolbarButton.Height / 5 * 4
        Case 3
            'Draw Item Select
            DrawDCTransparent lhDC, pToolbarButton.hdc, RC, ItemRECT, pToolbarButton.Width, pToolbarButton.Height / 5, 0
        Case 4
            'Draw Item Press
            DrawDCTransparent lhDC, pToolbarButton.hdc, RC, ItemRECT, pToolbarButton.Width, pToolbarButton.Height / 5, pToolbarButton.Height / 5
        Case 5
            'Draw Item DropDownButton Press
            With ItemRECT
               .Left = ItemLeft
               .Top = ItemTop + 2
               .Right = ItemWidth
               .Bottom = ItemHeight
            End With
            DrawDCTransparent lhDC, pToolbarButton.hdc, RC, ItemRECT, pToolbarButton.Width, pToolbarButton.Height / 5, pToolbarButton.Height / 5
        Case 6
            'Draw Item Button Press (DropDown)
            With ItemRECT
               .Left = ItemLeft
               .Top = ItemTop + 2
               .Right = ItemWidth - 12
               .Bottom = ItemHeight
            End With
            DrawDCTransparent lhDC, pToolbarButtonDropDown.hdc, RC, ItemRECT, pToolbarButtonDropDown.Width, pToolbarButtonDropDown.Height / 5, pToolbarButtonDropDown.Height / 5
            With ItemRECT
               .Left = ItemWidth - 12
               .Top = ItemTop + 2
               .Right = ItemWidth
               .Bottom = ItemHeight
            End With
            DrawDCTransparent lhDC, pToolbarButtonDropDownRight.hdc, RC, ItemRECT, pToolbarButtonDropDownRight.Width, pToolbarButtonDropDownRight.Height / 5, pToolbarButtonDropDownRight.Height / 5
        Case 7 'Draw a line for Dropdown Button
            StretchBlt lhDC, ItemRECT.Right - 14, ItemRECT.Top + 1, 2, ItemRECT.Bottom - 4, pToolbarButtonDropDown.hdc, 21, 1, 2, pToolbarButtonDropDown.Height / 5 - 2, vbSrcCopy
            'M.DrawLine lhDC, ItemRECT.Right - 13, 2, ItemRECT.Right - 13, tbHeight - 2, M.TranslateColors(&HC56A31)
        Case 8 'Draw a Picture DropDown
            ItemRECT.Left = ItemRECT.Right - 12
            If m.DrawThemes("Toolbar", hwnd, lhDC, ItemRECT.Left, ItemRECT.Top, ItemRECT.Right, ItemRECT.Bottom, 4, 1) = False Then
               m.DrawImage lhDC, MuiTenDown.Picture, ItemRECT.Right - 13, (tbHeight / 2) - 6, 13, 13
            End If
            ItemRECT.Left = ItemLeft
        Case 9
          'Draw Seperator
            m.DrawLine lhDC, ItemRECT.Left + 2, 5, ItemRECT.Left + 2, tbHeight - 5, m.ColorToRGB(vbButtonFace, 0, 0, 0, -55)
            m.DrawLine lhDC, ItemRECT.Left + 3, 6, ItemRECT.Left + 3, tbHeight - 4, m.ColorToRGB(vbButtonFace, 0, 0, 0, 95)
        Case 10
            'Draw Combobox
            If tbStatus = 0 Then
                m.DrawFill lhDC, ItemLeft, ItemTop + 3, ItemWidth, ItemHeight - 2, &HFBF2EA
                m.DrawFrame lhDC, ItemLeft, ItemTop + 3, ItemWidth, ItemHeight - 2, &HDEC1AB
            ElseIf (tbStatus = 2) Then
                m.DrawFill lhDC, ItemLeft, ItemTop + 3, ItemWidth, ItemHeight - 2, vbWhite
                m.DrawFrame lhDC, ItemLeft, ItemTop + 3, ItemWidth, ItemHeight - 2, &HDEC1AB
                With ItemRECT
                   .Left = ItemWidth - 15
                   .Top = ItemTop + 4
                   .Right = ItemWidth - 1
                   .Bottom = ItemHeight - 3
                End With
                DrawDC lhDC, pCombobox.hdc, RC, ItemRECT, pCombobox.Width, pCombobox.Height / 4, pCombobox.Height / 4
            ElseIf tbStatus = 3 Then
                m.DrawFill lhDC, ItemLeft, ItemTop + 3, ItemWidth, ItemHeight - 2, vbWhite
                m.DrawFrame lhDC, ItemLeft, ItemTop + 3, ItemWidth, ItemHeight - 2, &HDEC1AB
                With ItemRECT
                   .Left = ItemWidth - 15
                   .Top = ItemTop + 4
                   .Right = ItemWidth - 1
                   .Bottom = ItemHeight - 3
                End With
                DrawDC lhDC, pCombobox.hdc, RC, ItemRECT, pCombobox.Width, pCombobox.Height / 4, pCombobox.Height / 4 * 2
            End If
            'Draw a Arrow
            m.DrawLine lhDC, ItemWidth - 9, Fix(tbHeight / 2) - 2, ItemWidth - 4, Fix(tbHeight / 2) - 2, vbBlack
            m.DrawLine lhDC, ItemWidth - 8, Fix(tbHeight / 2) - 1, ItemWidth - 5, Fix(tbHeight / 2) - 1, vbBlack
            m.DrawLine lhDC, ItemWidth - 7, Fix(tbHeight / 2), ItemWidth - 6, Fix(tbHeight / 2) - 0, vbBlack
        Case 11 'Draw Listbox Popup
            If tbStatus = 0 Then
                m.DrawFill lhDC, ItemLeft + 1, ItemTop + 1, ItemWidth - 1, ItemHeight - 1, m.TranslateColors(vbHighlight)
            ElseIf tbStatus = 1 Then
                'Draw Text
                m.DrawText lhDC, PtrStr(hwnd), ItemRECT.Left + 2, ItemRECT.Top, ItemRECT.Right, ItemRECT.Bottom, DT_CENTER & DT_EXPANDTABS
            End If
        Case 12 'Return the Color Of Text MenuBar Selected and not selected
            'If tbStatus = 0 Then
            '    color Selected
            'Else
            '    color Not Selected
            'End If
            lReturn = vbBlack
    End Select
End Sub


Public Function MDMouseOver(ByVal HandleWindow As Long) As Boolean

Dim PT As POINTAPI

    GetCursorPos PT
    MDMouseOver = (WindowFromPoint(PT.X, PT.Y) = HandleWindow)
    
End Function

Private Function PointMouseOver(hwnd As Long) As Boolean

Dim PT As POINTAPI
Dim WR As RECT
    
    GetCursorPos PT
    ScreenToClient hwnd, PT
    GetWindowRect hwnd, WR
    'MDMouseOver = (WindowFromPoint(PT.X, PT.Y) = HandleWindow)
    Debug.Print WR.Right - WR.Left & "-" & WR.Bottom - WR.Top & "-" & PT.X & "-" & PT.Y
    
End Function

Public Sub ThemeMenus(ByVal hwnd As Long, ByVal lhDC As Long, ByVal plDraw As Integer, ByVal State As Integer, ByVal mnLeft As Long, ByVal mnTop As Long, ByVal mnRight As Long, ByVal mnBottom As Variant, Optional wParam As Long)
    Dim mRECT As RECT, RC As RECT
    On Error Resume Next
    
    With mRECT
        .Left = mnLeft
        .Top = mnTop
        .Right = mnRight
        .Bottom = mnBottom
    End With
    
    With RC
       .Left = 3
       .Top = 3
       .Right = 3
       .Bottom = 3
    End With
    
    Select Case plDraw
        Case 0
            'Draw Menu Bar
            If State = 0 Then
               'Ve Nen cua Bar
                'DrawDC lhDC, pToolbar.hdc, RC, mRECT, pToolbar.Width, pToolbar.Height, 0
                'm.DrawFill lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, m.TranslateColors(vbButtonFace)
            ElseIf State = 1 Then
               'Ve nen cua Menu
                m.DrawFill lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, m.TranslateColors(vbButtonFace)
            End If
        Case 1
            'Draw TopMenu Selected
            If State = 0 Then
               'Top Menu Press
               DrawDCTransparent lhDC, pToolbarButton.hdc, RC, mRECT, pToolbarButton.Width, pToolbarButton.Height / 5, pToolbarButton.Height / 5
               'm.DrawFrame lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, m.TranslateColors(vbButtonShadow)
            ElseIf State = 1 Then
               'Top Menu Hottrack
               DrawDCTransparent lhDC, pToolbarButton.hdc, RC, mRECT, pToolbarButton.Width, pToolbarButton.Height / 5, 0
               'm.DrawFill lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, m.TranslateColors(&HEDD0BF)
               'm.DrawFrame lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, m.TranslateColors(&HC56A31)
            End If
        Case 2
            'Draw Background and Left PopUp Menu
            If State = 0 Then 'Left PopUp Menu
                'm.DrawFill lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, m.TranslateColors(vbButtonFace)
                StretchBlt lhDC, mRECT.Left, mRECT.Top, mRECT.Right - mRECT.Left, mRECT.Bottom - mRECT.Top, pMenuLeft.hdc, 0, 0, pMenuLeft.Width, pMenuLeft.Height, vbSrcCopy
            Else 'Draw Background
                m.DrawFill lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, m.TranslateColors(vbWhite)
            End If
       Case 3
          'Draw Separator
          m.DrawLine lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Top, m.TranslateColors(vbButtonShadow)
       Case 4 ' Draw Menu Item
            If State = 0 Then 'Draw Select Menu
                DrawDC lhDC, pMenuItem.hdc, RC, mRECT, pMenuItem.Width, pMenuItem.Height / 2, 0
            Else 'Draw Select Menu Disabled
                DrawDC lhDC, pMenuItem.hdc, RC, mRECT, pMenuItem.Width, pMenuItem.Height / 2, pMenuItem.Height / 2
            End If
       Case 5 'Draw Check
            If State = 0 Then 'Draw Check Disabled
               DrawDC lhDC, pMenuCheckBorder.hdc, RC, mRECT, pMenuCheckBorder.Width, pMenuCheckBorder.Height / 3, pMenuCheckBorder.Height / 3
            ElseIf State = 1 Then 'Draw Check Selected
               DrawDC lhDC, pMenuCheckBorder.hdc, RC, mRECT, pMenuCheckBorder.Width, pMenuCheckBorder.Height / 3, 0
            ElseIf State = 2 Then 'Draw Check
               DrawDC lhDC, pMenuCheckBorder.hdc, RC, mRECT, pMenuCheckBorder.Width, pMenuCheckBorder.Height / 3, 0
            End If
        Case 6 'Draw Border Menu Popup
            m.DrawFrame lhDC, mRECT.Left, mRECT.Top, mRECT.Right, mRECT.Bottom, vbButtonShadow
    End Select
End Sub

Public Sub ThemePopupColor(ByVal hwnd As Long, ByVal lhDC As Long, ByVal plDraw As Integer, ByVal X As Long, ByVal Y As Long, ByVal X1 As Long, ByVal Y1 As Long)
    Select Case plDraw
        Case 0  'Draw Vertical Bar
            m.DrawFill lhDC, X, Y, X1, Y1, vbButtonFace
        Case 1  'Draw Select cell color
            m.DrawFill lhDC, X, Y, X1, Y1, m.TranslateColors(&HEDD0BF)
            m.DrawFrame lhDC, X, Y, X1, Y1, m.TranslateColors(&HC56A31)
        Case 2  'Draw cell color
            m.DrawFill lhDC, X, Y, X1, Y1, m.TranslateColors(&HEDD0BF)
            m.DrawFrame lhDC, X, Y, X1, Y1, m.TranslateColors(&HC56A31)
        Case 3  'Draw the border of popup
            m.DrawFrame lhDC, X, Y, X1, Y1, vbButtonShadow
    End Select
End Sub

Public Sub ThemeMDITab(ByVal lhWnd As Long, ByVal lhDC As Long, ByVal plDraw As Integer, ByVal X As Single, ByVal Y As Single, ByVal X1 As Single, ByVal Y1 As Single, Optional lReturn As Long)
    Dim RC As RECT
    Dim cr As RECT
    
    With RC
        .Left = 22
        .Top = 2
        .Right = 3
        .Bottom = 2
    End With
    
    With cr
        .Left = X - 20
        .Top = Y
        .Right = X1 - 2
        .Bottom = Y1
    End With
    
    Select Case plDraw
        Case 1 'Draw Background Tab
            m.DrawFill lhDC, X, Y, X1, Y1 + 1, m.TranslateColors(&HFFDBBF)
        Case 2 'Draw Tab Top
            TransparentBlt lhDC, X - 15, Y + 1, RC.Left, pMDITab.Height / 2, pMDITab.hdc, 0, 0, RC.Left, pMDITab.Height / 2, 16711935
            TransparentBlt lhDC, X - 15 + RC.Left, Y + 1, X1 - RC.Right - X - 9, pMDITab.Height / 2, pMDITab.hdc, RC.Left, 0, pMDITab.Width - RC.Right - RC.Left, pMDITab.Height / 2, 16711935
            TransparentBlt lhDC, X1 - 5, Y + 1, 2, pMDITab.Height / 2, pMDITab.hdc, pMDITab.Width - 2, 0, 2, pMDITab.Height / 2, 16711935
        Case 5 'Draw Tab Top Not Select
            TransparentBlt lhDC, X - 15, Y + 1, RC.Left, pMDITab.Height / 2, pMDITab.hdc, 0, pMDITab.Height / 2, RC.Left, pMDITab.Height / 2, 16711935
            TransparentBlt lhDC, X - 15 + RC.Left, Y + 1, X1 - RC.Right - X - 6, pMDITab.Height / 2, pMDITab.hdc, RC.Left, pMDITab.Height / 2, pMDITab.Width - RC.Right - RC.Left, pMDITab.Height / 2, 16711935
            TransparentBlt lhDC, X1 - 2, Y + 1, 2, pMDITab.Height / 2, pMDITab.hdc, pMDITab.Width - 2, pMDITab.Height / 2, 2, pMDITab.Height / 2, 16711935
            
            If lReturn Then
                TransparentBlt lhDC, X - 15, Y + 1, 5, pMDITab.Height / 2, pMDITab.hdc, RC.Left, 0, pMDITab.Width - RC.Right - RC.Left, pMDITab.Height / 2, 16711935
                TransparentBlt lhDC, X - 10, Y + 1, 2, pMDITab.Height / 2, pMDITab.hdc, pMDITab.Width - 2, 0, 2, pMDITab.Height / 2, 16711935
            End If
        Case 6 'Draw Border Of MDITab
            StretchBlt lhDC, X, Y, 5, 5, pMDITabFrame.hdc, 0, 0, 5, 5, vbSrcCopy
            StretchBlt lhDC, X + 5, Y, X1 - 5 - X, 5, pMDITabFrame.hdc, 5, 0, 2, 5, vbSrcCopy
            StretchBlt lhDC, X1 - 5, Y, 5, 5, pMDITabFrame.hdc, pMDITabFrame.Width - 5, 0, 5, 5, vbSrcCopy
            StretchBlt lhDC, X1 - 5, Y + 5, 5, Y1 - Y - 5, pMDITabFrame.hdc, pMDITabFrame.Width - 5, 5, 5, 2, vbSrcCopy
            StretchBlt lhDC, X1 - 5, Y1 - 5, 5, 5, pMDITabFrame.hdc, pMDITabFrame.Width - 5, pMDITabFrame.Height - 5, 5, 5, vbSrcCopy
            StretchBlt lhDC, X + 5, Y1 - 5, X1 - 10 - X, 5, pMDITabFrame.hdc, 5, pMDITabFrame.Height - 5, 2, 5, vbSrcCopy
            StretchBlt lhDC, X, Y1 - 5, 5, 5, pMDITabFrame.hdc, 0, pMDITabFrame.Height - 5, 5, 5, vbSrcCopy
            StretchBlt lhDC, X, Y + 5, 5, Y1 - 10 - Y, pMDITabFrame.hdc, 0, 5, 5, 2, vbSrcCopy
        Case 7 'Return the Left size of Button
            lReturn = 15
        Case 8 'Return the adding size
            lReturn = 5
        Case 10 'Draw Next Line
            m.DrawLine lhDC, X, Y + 2, X1, Y1 + 2, m.TranslateColors(&HE2B598)
        Case 11 'Draw Back Line
            m.DrawLine lhDC, X, Y + 2, X1 - 15, Y1 + 2, m.TranslateColors(&HE2B598)
        Case 12 'Draw Close Button
            If lReturn = 1 Then  ' Press
                m.DrawFill lhDC, X, Y, X1, Y1, m.TranslateColors(&HEDD0BF)
                m.DrawFrame lhDC, X, Y, X1, Y1, m.TranslateColors(&HC56A31)
            'ElseIf lReturn = 0 Then 'Normal
            End If
            m.DrawLine lhDC, X + 3, Y + 4, X + 11, Y + 12, vbBlack
            m.DrawLine lhDC, X + 4, Y + 4, X + 12, Y + 12, vbBlack
            m.DrawLine lhDC, X + 3, Y + 11, X + 11, Y + 3, vbBlack
            m.DrawLine lhDC, X + 4, Y + 11, X + 12, Y + 3, vbBlack
    End Select
End Sub
